/**
 * @Copyright:Copyright (c) 1992 - 2015
 * @Company: TengTong
 */
package com.tengtong.duang.commons.utils.helper;

import com.tengtong.duang.commons.base.ClassFilter;
import com.tengtong.duang.commons.utils.ReflectUtils;

/**
 * 继承过滤器，过滤继承某类或某接口（包括父类上的继承）
 *
 * @author Jai
 * @since: v1.0
 */
public class InheritanceFilter implements ClassFilter{

	private final Class<?> parent;
	
	public InheritanceFilter(final Class<?> clazz){
		this.parent = clazz;
	}

	/**
	 */
	@Override
	public boolean test(Class<?> t) {
		return ReflectUtils.isInheritance(t, parent);
	}

}
